import React from 'react';
import { Button } from 'antd';
import AuthComponent from '@/utils/auth/AuthComponent';
import PureAuthComponent from '@/utils/auth/PureAuthComponent';
import AuthCode from '@/utils/auth/AuthCode';

const { authCode } = new AuthCode('office:orgs:post');
const Demo = () => (
    <React.Fragment>
        <AuthComponent code={authCode('add')}>
            <Button>职位添加</Button>
        </AuthComponent>

        {/* 无包裹 */}
        <PureAuthComponent code={authCode('add')}>
            <Button>职位添加</Button>
        </PureAuthComponent>
    </React.Fragment>
);

export default Demo;
